import moment from 'moment';

export default {
  column: [
    {
      label: "维修分类",
      prop: "fix_category_info",
      showtooltip: true,
      minWidth: "150"
    }, {
      label: "报修用户",
      prop: "alias",
      minWidth: "120",
      type: 0,
    },
    {
      label: "联系电话",
      prop: "mobile",
      type: 0,
      width: 130
    },
    {
      label: "报修地址",
      prop: "detail_address",
      type: 0,
      showtooltip: true,
      minWidth: "180"
    },
    {
      label: "问题描述",
      prop: "remark",
      type: 0,
      showtooltip: true,
      minWidth: "200"
    },
    {
      label: "当前处理人",
      prop: "participant",
      type: 0,
      width: "160",
    },
    // {
    //   label: "处理时长",
    //   prop: "processtime",
    //   type: 0,
    //   width: "160",
    //   formatter: (row) => {
    //     var x = row.processtime
    //     var tempTime = moment.duration(x * 1000);
    //     if (tempTime.days() > 0) {
    //       return tempTime.days() + "天" + tempTime.hours() + "时" + tempTime.minutes() + "分";
    //     } else if (tempTime.hours() > 0) {
    //       return tempTime.hours() + "时" + tempTime.minutes() + "分";
    //     } else if (tempTime.minutes() > 0) {
    //       return tempTime.minutes() + "分钟";
    //     }
    //   }
    // },
    {
      label: "申请日期",
      prop: "gmt_created",
      type: 0,
      width: "160",
    },
    {
      label: "状态",
      prop: "is_draft",
      formatter: (row) => {
        if (row.is_draft == 0) {
          return "待接单"
        } else if (row.is_draft == 4) {
          return "待维修"
        } else if (row.is_draft == 5) {
          return "已维修"
        } else if (row.is_draft == 6) {
          return "已完成"
        } else if (row.is_draft == 7) {
          return "已评价"
        } else if (row.is_draft == 8) {
          return "已取消"
        } else {
          return ""
        }
      }
    },
  ]
}
